﻿
//Declare a global variable in main javascript file
var baseUrl = "";

//Set baseUrl to the value of "HiddenCurrentUrl" when this javascript is loaded
baseUrl = $("#HiddenCurrentUrl").val();
baseUrl = baseUrl.substring(0, baseUrl.indexOf("Dummy"));

function CustomLayoutModal() {
    (function ($) {

        $(document)
            .on('hidden.bs.modal', '.modal', function () {
                $(document.body).removeClass('modal-noscrollbar');
            })
            .on('show.bs.modal', '.modal', function () {
                // Bootstrap adds margin-right: 15px to the body to account for a
                // scrollbar, but this causes a "shift" when the document isn't tall
                // enough to need a scrollbar; therefore, we disable the margin-right
                // when it isn't needed.

                //if ($(window).height() <= $(document).height()) {
                $(document.body).addClass('modal-noscrollbar');
                //}
            });

    })(window.jQuery);
}

function ProgressShow() {
    var url = "http://localhost/QuanLyKhachSan/Common/ProgressShow"; // the url to the controller

    //$.get(url, function (data) {
    //    $('#progress-show-container').html(data);
    //    $('#progress-show').modal('show');
    //    $(document.body).addClass('modal-noscrollbar');
    //    CustomLayoutModal();
    //});

    $('#progress-show').modal('show');
    $(document.body).addClass('modal-noscrollbar');
    CustomLayoutModal();
}

function ProgressHide() {
    $('#progress-show').modal('hide');
}